An encoder measures the angle of rotation and length of movement of a specimen, and is utilized as a sensor in robots and machine tools. The measurement values measured by this encoder (information related to an angle and length, called “encoder data” in the following explanation) are sent to a control device or other such host machine via a communication device, which carries out serial communications by way of a communication line. As forms of serial communications, either one-way communications or two-way communications are used, and in one-way communications, the encoder converts encoder data to serial data, and outputs the data at a certain fixed time cycle. Conversely, in two-way communications, it is common for the constitution to be such that the encoder receives a command signal from the host machine, and sends encoder data corresponding to the contents of this command signal (For example, refer to Japanese Laid-open Patent No. 2004-317261).
When an encoder such as this is used for sampling the state of a specimen, the sampling time during which encoder data can be acquired from the host machine is limited to the encoder data communication time. For example, the communication cycle T1 for one-way communications is determined by the encoder data ED transmission time TD and wait time TW as shown in FIG. 3A, and the communication cycle T2 for two-way communications is determined by command data CD transmission time TC, encoder data ED transmission time TD and wait times TW1, TW2 as shown in FIG. 3B.
Robot and machine tool operation has been speeded up in recent years, and in line with this, there is a requirement to shorten the state sampling interval of the encoder, thus making it desirable to speed up the serial communications of the communication device used by an encoder.
However, the information that a host machine acquires from an encoder is no longer limited to just the measurements of conventional angles and lengths, and the amount of encoder information, such as status information, temperature information, and memory information, is increasing. For this reason, it is not possible to shorten the sampling interval of one-way communications due to the longer communication time resulting from the increase in the amount of data. Meanwhile, in the case of two-way communications, information outputted from an encoder can be selected in accordance with a request signal (the command data in FIG. 3B) from a host machine, but since the transmission and reception of command data from a host machine, and encoder data from an encoder are carried out within a single communication cycle, the communication cycle as a whole cannot be shortened. The problem such conventional encoders is that it takes time to communicate encoder data.